<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ALORK 20150428.01" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

<title><?php echo $this->_var['page_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link rel="stylesheet" href="./public/my_style.css" />
<link rel="stylesheet" href="./public/style.css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'./../js/jquery.js')); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'./../js/common.js,./../js/mobile-common.js,')); ?>
<body>
<?php echo $this->fetch('library/user_head.lbi'); ?>


<div class="body">
  <div id="u_login" >
        <form action="user.php" name="formLogin" id="formLogin" method="post" onsubmit="return userLogin()" >
        
        <div class="input">
            <div class="username">
              <div class="user_b">账号</div>   
              <input type="text" name="username" id="username" placeholder="用户名/手机号/Email" onfocus="this.value=''"  class="text_input" />
            </div>

            <div class="password">
              <div class="pass_b">密码</div>
              <input type="text" name="password" id="password" placeholder="密码" onfocus="this.value=''; this.type='password'" class="text_input" />
            </div>
        </div>

        <input type="hidden" name="act" value="act_login" />
        <input type="hidden" name="back_act" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
        <div class="forget"><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=2&uin=800099584" style="float:right;">忘记密码</a></div>
        <div class="submits" onclick="ajax_login();" >登陆</div>
        </form>
        <div class="b_text">
          <a href="user.php?act=register" >快速注册</a>
        </div>

        <div class="else none">
            <div style="float:left;"><img src="./public/left-line.png" width="105" height="1" /></div>
            <div style="width:110px; text-align: center; float:left;">其他方式登录</div>
            <div style="float:right;"><img src="./public/right-line.png" width="105" height="1"  /></div>
        </div>

        <div class="icon">
            <a href="connect.php?act=weibo" class="sina">新浪微博</a>
            <a href="connect.php?act=qq" class="qq ">QQ</a>
            <a href="connect.php?act=weixin" class="weixin "style="display: none">微信好友</a>
        </div>

  </div>

</div>

<script type="text/javascript">
// alert(location.href);
function getArgs(){
    var args = {};
    var match = null;
    var search = decodeURIComponent(location.search.substring(1));
    var reg = /(?:([^&]+)=([^&]+))/g;
    while((match = reg.exec(search))!==null){
        args[match[1]] = match[2];
    }
    return args;
}  
  function ajax_login(){

      url="user.php?act=signin&r="+Math.random();
      htmlobj=$.post(url, {'username' : $('#username').val(), 'password' : $('#password').val() ,'remember':'0', 'captcha':$('#captcha').val()}, function(data){
        json_return(data);
      },'JSON');
  }
  // 处理登录返回信息
  function json_return(data){
    if(data.error==0){
      <?php if ($_GET['user']): ?>
        window.location.href="user.php";
      <?php else: ?>
        window.location.href="<?php echo $_SERVER['HTTP_REFERER']; ?>";
      <?php endif; ?>
    }
    else{
      point(data.content,1);
      // if(data.fail){
      //   $("#fail").show();
      // }
      // if($("#fail").css("display")=="block"){
      //   var src='captcha.php?is_login=1&'+Math.random();
      //   $("#fail").find("img").attr("src",src);
      // }
      // $('.message').show().html(data.content).delay(500).hide(700);
    }
  }
  </script>



</body>

</html>
